package com.tantou.java.struct.queue;

public class TantouStack {

    private String[] items;

    private int count;

    public TantouStack(int count) {
        this.count = count;
    }

    public boolean push(String item) {
        if (item == null) return false;
        if (count >= items.length) return false;
        items[count] = item;
        count++;
        return true;
    }

    public String pop() {
        if (count == 0) return null;
        String tmp = items[count - 1];
        items[count - 1] = null;
        count--;
        return tmp;
    }
}
